<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS选择器</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #title {
            color: red;
        }

        h1,
        .hello,
        strong {
            background-color: blueviolet;
        }

        .box p {
            border: 10px solid;
        }

        .box>p {
            background-color: coral;
        }


        .first~p {
            font-size: 40px;
        }

        .first+p {
            color: deeppink;
        }

       
    </style>
</head>

<body>

    <div class="box">
        <h3>一个子标签</h3>
        <p>子代的p标签</p>
        <div>
            <p class="first">孙子的p标签</p>
            <p>孙子的p标签</p>
            <p>孙子的p标签</p>
            <span>孙子的span标签</span>
        </div>
    </div>

    <!-- 1. 同一个页面id名不能重复 2.每一个标签最多只能有一个id -->
    <h1 id="title">你好</h1>
    <h1 class="hello">你好</h1>
    <p class="hello">你好</p>
    <strong>字体加粗</strong>
</body>

</html>